Metadata Setup
This guide shows you how to configure metadata for your OV20i camera images. Metadata is custom information that gets stored with each captured image, helping you track important details like part numbers, serial numbers, or production data.
When to Use Metadata: Production tracking, part identification, quality control records, batch information, operator identification, or any custom data you need to associate with inspection images.
Prerequisites
- OV20i camera system set up and connected
- Active recipe configured with imaging and inspection setup
- At least one AI block (classification or segmentation) configured
- Understanding of the data you want to track from inspection results
What is Metadata?
Metadata is additional information that gets attached to each captured image. This information:
- Stores with the image in the camera's library
- Appears in the HMI for operators to see
- Helps identify and track specific parts or production runs
- Can be searched in the library for analysis
Examples of useful metadata:
- Part numbers (e.g., "P12345")
- Serial numbers (e.g., "SN987654")
- Operator names (e.g., "John_Smith")
- Shift information (e.g., "A_Shift")
- Batch numbers (e.g., "Batch_2025_001")
Metadata can only be saved when an inspection is completed. The metadata must be part of the flow that starts from "All Block Outputs" after the camera captures and processes an image.
Step 1: Access Node-RED Editor
1.1 Navigate to IO Block
- Open your active recipe in Recipe Editor
- Click "IO Block" in breadcrumb menu
- Click "Configure IO" to enter Node-RED editor
1.2 Verify Node-RED Interface
Checkpoint: You should see the Node-RED flow editor with the existing IO Block flow and node palette on the left side.
Step 2: Locate the "All Block Outputs" Node
2.1 Find the Starting Point
In your Node-RED flow, look for the "All Block Outputs" node. This is the starting point that receives data from the camera after an inspection is triggered and processed.
The "All Block Outputs" node:
- Contains inspection results from all AI blocks
- Includes image capture information
- Provides the data needed for metadata creation
- Is the source that feeds both metadata and pass/fail decisions
2.2 Understand the Flow Structure
Your flow should follow this pattern:
Camera Trigger → AI Processing → All Block Outputs → [Your Custom Logic]
From "All Block Outputs" you need two separate paths:
- Metadata Path: All Block Outputs → Function (Create Metadata) → Capture Metadata
- Decision Path: All Block Outputs → Function (Logic) → Final Pass/Fail
Both the metadata and pass/fail decisions must branch from the "All Block Outputs" node.
Step 3: Add Capture Metadata Node
3.1 Locate Metadata Node
- Find "Capture Metadata" node in the left panel (Overview section)
- Drag "Capture Metadata" node onto the flow canvas
- Position it in your flow after the trigger but before image capture
3.2 Node Placement in Flow
Correct flow structure:
All Block Outputs → Function (Create Metadata) → Capture Metadata
↓
Function (Pass/Fail Logic) → Final Pass/Fail
The "Final Pass/Fail" node is required for the flow to work properly. Every flow must end with this node.
Step 4: Configure Metadata Fields
4.1 Set Up Basic Metadata
- Double-click the Capture Metadata node
- Configure the metadata fields you want to track
- Set up data sources for each field
4.2 Metadata Format Requirements
Important: The metadata must be formatted as an object with:
- String keys - Field names must be text
- String or number values - Data can be text or numbers
Correct format example:
{
"part_number": "P12345",
"serial_number": "SN987654",
"operator": "John_Smith",
"shift": "A",
"quantity": 100,
"temperature": 23.5
}
Step 5: Create Metadata Function Node
5.1 Add Function Node for Metadata Creation
- Add a "function" node between "All Block Outputs" and the "Capture Metadata" node
- Double-click the function node to configure it
- This function will extract data from the inspection results and create metadata
5.2 Extract Data from All Block Outputs
The "All Block Outputs" node provides rich inspection data. Here's how to extract it:
// Extract data from inspection results
const captureId = msg.payload.capture_id;
const serialNumber = msg.payload.serial_number || "No_Serial";
const inspectionTime = msg.payload.inspection_time || new Date().toISOString();
// Create metadata from inspection data
msg.payload = {
"capture_id": captureId,
"serial_number": serialNumber,
"inspection_time": inspectionTime,
"operator": global.get("current_operator") || "Unknown"
};
return msg;
5.3 Static Metadata (Fixed Values)
For information that doesn't change during production:
// Set static metadata values
msg.payload = {
"recipe_name": "Bolt_Inspection_v2",
"line_number": "Line_3",
"shift": "A_Shift",
"station": "QC_Station_1"
};
return msg;
5.4 Dynamic Metadata (Using Inspection Data)
For information that comes from the inspection results:
// Extract inspection data
const captureId = msg.payload.capture_id;
const imageUrl = msg.payload.image_url;
const predictions = msg.payload.classification?.predictions || [];
// Create dynamic metadata
msg.payload = {
"capture_id": captureId,
"part_number": "P" + Date.now(),
"total_rois": predictions.length,
"timestamp": new Date().toISOString(),
"batch": global.get("current_batch") || "Default_Batch"
};
return msg;
Step 6: Connect Metadata and Pass/Fail Flows
6.1 Required Flow Structure
Every flow must have both paths from "All Block Outputs":
All Block Outputs → Function (Create Metadata) → Capture Metadata
↓
Function (Pass/Fail Logic) → Final Pass/Fail
6.2 Wire the Metadata Path
- Connect "All Block Outputs" output to your metadata function input
- Connect metadata function output to "Capture Metadata" input
- The Capture Metadata node can be a terminal node (no output connection needed)
6.3 Wire the Pass/Fail Path
- Connect "All Block Outputs" output to a pass/fail logic function
- Connect the logic function output to "Final Pass/Fail" input
- The "Final Pass/Fail" node is mandatory - every flow must end here
6.4 Example Pass/Fail Logic Function
// Extract inspection result for pass/fail decision
const predictions = msg.payload.classification?.predictions || [];
// Determine if inspection passed (all ROIs passed)
let passed = true;
for (let prediction of predictions) {
if (!prediction.predicted_class.includes("pass")) {
passed = false;
break;
}
}
// Set the pass/fail result
msg.payload = passed;
return msg;
Step 7: Test Metadata Configuration
7.1 Deploy and Test
- Click "Deploy" button (top-right corner)
- Trigger an inspection using your configured trigger method (manual, digital input, or PLC)
- Verify that:
- An image was captured
- Metadata appears with the image
- Pass/fail decision was made
- Flow completed successfully
7.2 Verify Complete Flow
Check that both paths work:
Metadata Path:
- Navigate to Library in main interface
- Find your test image
- Verify metadata appears in image details
Pass/Fail Path:
- Check that inspection results show pass/fail status
- Verify the "Final Pass/Fail" node processed correctly
- Confirm any connected outputs (PLCs, indicators) respond appropriately
7.3 Test Different Trigger Sources
Verify metadata works with your specific trigger:
For Manual Triggers:
- Use software trigger button
- Verify metadata appears with each manual capture
For Digital Input Triggers:
- Activate external sensor/switch
- Confirm metadata is captured with triggered images
For PLC Triggers:
- Send trigger signal from PLC
- Verify metadata includes PLC data if applicable
Step 8: Advanced Metadata Configurations
8.1 Metadata from Multiple Global Variables
Combine data from different sources stored globally:
// Combine data from various global storage
const operatorData = global.get("operator_info") || {};
const productData = global.get("product_info") || {};
const shiftData = global.get("shift_info") || {};
msg.payload = {
"operator": operatorData.name || "Unknown",
"operator_id": operatorData.id || "000",
"product_code": productData.code || "Default",
"product_version": productData.version || "1.0",
"shift": shiftData.current || "Day",
"line_status": "Running",
"timestamp": new Date().toISOString()
};
return msg;
Step 9: Troubleshooting Metadata Issues
9.1 Common Problems
Problem | Symptoms | Solution |
---|---|---|
Metadata not appearing | No data in Library | Verify metadata node is in main IO Block flow |
Metadata with wrong image | Data appears with incorrect captures | Check timing - metadata must be before image capture |
Trigger not working | No images captured | Verify IO Block trigger configuration |
Missing metadata fields | Some data missing | Check function node payload format |
Wrong data type error | Node shows error status | Ensure values are strings or numbers only |
9.2 Debug Metadata Flow
Add debug nodes to troubleshoot:
- Add debug node after trigger to verify trigger works
- Add debug node after metadata function to check payload
- Add debug node after Capture Metadata to confirm processing
- Check debug panel for error messages
Step 10: Best Practices
10.1 Flow Design
Design efficient metadata flows:
- Keep metadata early in flow - Set metadata immediately after trigger
- Use single metadata node - Don't duplicate Capture Metadata nodes
- Maintain flow continuity - Metadata must be part of main inspection flow
- Handle missing data - Always provide default values
10.2 Metadata Field Naming
Use consistent, clear field names:
- Use underscores instead of spaces ("part_number" not "part number")
- Be descriptive but concise ("operator" not "op")
- Use lowercase for consistency
- Avoid special characters that might cause issues
10.3 Performance Considerations
For high-volume production:
- Minimize metadata size - Only include necessary information
- Use efficient data types - Numbers when possible, short strings
- Avoid complex processing - Keep metadata creation simple and fast
- Cache global data - Store frequently used data in global variables
Success! Your Metadata System is Ready
Your metadata configuration can now:
✅ Attach custom information to every triggered image capture
✅ Track production data synchronized with inspection flow
✅ Store searchable information in the camera library
✅ Display relevant data in the HMI for operators
✅ Support traceability for manufacturing requirements
Ongoing Maintenance
Regular System Checks
- Verify metadata appears with triggered captures
- Check for missing data in production runs
- Monitor flow performance with high trigger rates
- Update metadata fields as requirements change
Flow Management
- Review metadata timing in production
- Optimize function node performance
- Update global variable management
- Train operators on trigger-based operation
Next Steps
After setting up trigger-based metadata:
- Test with all configured trigger types (manual, digital, PLC)
- Train operators on proper trigger usage for metadata capture
- Set up global variable management for dynamic data
- Create metadata templates for different product lines
- Implement production monitoring using metadata analytics